package cn.xuqiudong.backend.config.doc;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;


;

/**
 * 描述:
 * <a href="https://springdoc.org/#migrating-from-springfox">migrating</a>
 * <a href="https://springdoc.org/#properties">properties</a>
 *
 * @author Vic.xu
 * @see org.springdoc.core.properties.SpringDocConfigProperties
 * @see org.springdoc.core.configuration.SpringDocConfiguration
 * @since 2025-02-21 19:34
 */
@Configuration
@ConditionalOnProperty(name = {"springdoc.api-docs.enabled"}, matchIfMissing = false)
public class SpringDocOpenApiConfig {

    private static final Logger LOGGER = LoggerFactory.getLogger(SpringDocOpenApiConfig.class);


    /**
     * springdoc openApi  的元数据信息
     */
//    @Bean
    public OpenAPI springBackendOpenAPI() {
        return new OpenAPI()
                .info(new Info().title("lcxm backend project")
                                .description("一些个人的日常使用的东西")
                                .version("3.0.0")
                        .license(new License().name("Apache 2.0").url("https://xuqiudong.cn"))
                )
                .externalDocs(new ExternalDocumentation()
                        .description("后台项目重构")
                        .url("https://xuqiudong.atlassian.net/browse/CONSOLE"));
    }


}
